package com.jasper.mapper;

import com.jasper.pojo.vo.ItemCommentVo;
import com.jasper.pojo.vo.SearchItemsVo;
import com.jasper.pojo.vo.ShopcartVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ItemsMapperCustom {
    List<ItemCommentVo> queryItemComments(@Param("paramsMap") Map<String, Object> map );

    List<SearchItemsVo> searchItems(@Param("paramsMap") Map<String, Object> map);

    List<SearchItemsVo> searchItemsByThirdCat(@Param("paramsMap") Map<String, Object> map);

    List<ShopcartVO> queryItemsBySpecIds(@Param("paramsList") List<String> specIdList);

    /**
     * 购车减库存 乐观锁 sql
     *
     * @param specId        规格id
     * @param pendingCounts 购买数量
     * @return 减库存的数量 int
     */
    public int decreaseItemSpecStock(@Param("specId") String specId,
                                     @Param("pendingCounts") int pendingCounts);
}